home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiniExamples / AppKit / WhatsUpDoc / DocController.h < prev    next >
Text File  |  1995-06-12  |  2KB  |  82 lines

  1. /* DocController.h
  2.  * Purpose:  This is the main controlling class for this application.
  3.  *    DocController loads the Info and Help nib files on demand.
  4.  *    DocController also handles the multiple documents that can
  5.  *    be open at any time using the Document class -- including
  6.  *    keeping a count, tracking the current active document, 
  7.  *    managing the open and save panels, etc.
  8.  *
  9.  * You may freely copy, distribute, and reuse the code in this example.
  10.  * NeXT disclaims any warranty of any kind, expressed or  implied, as to its
  11.  * fitness for any particular use.
  12.  *
  13.  * Written by: R. Dunbar Poor
  14.  * Created: 28/April/1991
  15.  *
  16.  */
  17. #import <objc/Object.h>
  18. #import <objc/List.h>
  19.  
  20. @interface DocController:Object
  21. {
  22.   id    helpPanel;        /* the help panel */
  23.   id    infoPanel;        /* the info panel */
  24.   id    activeDocument;
  25.   /*
  26.    * the following are for debugging (and demonstration) only
  27.    */
  28.   int    documentCount;        /* # of documents */
  29.   id    activeDocumentField;    /* indicator of the current document */
  30.   id    documentCountField;    /* indicator of documentCount */
  31.   /*
  32.    * the following are outlets to menu cells that we want to enable
  33.    * and disable on occasion.
  34.    */
  35.   id    saveMenu;
  36.   id    saveAsMenu;
  37.   id    saveToMenu;
  38.   id    saveAllMenu;
  39.   id    revertMenu;
  40.   id    closeMenu;
  41. }
  42.  
  43. - init;
  44. - free;
  45.  
  46. - showInfo:sender;
  47. - showHelp:sender;
  48.  
  49. - activeDocument;
  50. - setActiveDocument:aDocument;
  51. /*
  52.  * return (or set) the document to which save, saveAs, revert, etc 
  53.  * messages will be sent.
  54.  */
  55.  
  56. - unsetActiveDocument:aDocument;
  57. /*
  58.  * if aDocument is the activeDocument, resign it from that role.
  59.  */
  60.  
  61. - open:sender;
  62. - new:sender;
  63. - save:sender;
  64. - saveAs:sender;
  65. - saveTo:sender;
  66. - saveAll:sender;
  67. - revert:sender;
  68. - close:sender;
  69.  
  70. - performForDocuments:(SEL)aSelector with:anObject;
  71. /*
  72.  * Send [self aSelector :aDocument :anObject] for each Document in the
  73.  * application.
  74.  */
  75.  
  76. - (int)app:sender openFile:(const char *)path type:(const char *)type;
  77. - (BOOL)appAcceptsAnotherFile:sender;
  78. - appDidInit:sender;
  79. - appWillTerminate:sender;
  80.  
  81. @end
  82.